package cn.wowjoy.pda.android_pharmacy.mvvm.vm.staticH;

import java.util.ArrayList;

import cn.wowjoy.pda.android_pharmacy.common.core.BaseViewModel;
import cn.wowjoy.pda.android_pharmacy.model.xmlEntity.inHospitalPatientInfo.InHospitalPatientBeen;

/**
 * Created by Administrator on 2017/8/15.
 */

public class StaticTakeProgressViewModel extends BaseViewModel {
    //每次被移除的一个Been
    public InHospitalPatientBeen remove;
    public ArrayList<InHospitalPatientBeen> FirstTotal;
    //第一次的全部数据 实体类   每取一次就把第一个移出去，放入到另外一个集合
    public ArrayList<InHospitalPatientBeen> mMoveBaens;
//    public  ArrayList<InHospitalPatientBeen> mTestBeen = new ArrayList<>();

    public  boolean updateResult =false;
    public void show(ArrayList<InHospitalPatientBeen> mDatas) {
        if (null == FirstTotal)
            FirstTotal = new ArrayList<>();
        FirstTotal.clear();
        FirstTotal.addAll(mDatas);

        if (null == mMoveBaens)
            mMoveBaens = new ArrayList<>();
        mMoveBaens.clear();
        mMoveBaens.addAll(mDatas);
    }
    //获取当前集合中即将移除的第一个
    public InHospitalPatientBeen remove() {
        if (null != mMoveBaens && mMoveBaens.size()>0) {
            remove=mMoveBaens.remove(0);
            return remove;
        }
        return null;
    }
    //获取移除后当前集合中的第一个
    public InHospitalPatientBeen getFirst() {
        if (null != mMoveBaens)
            return mMoveBaens.get(0);

        return null;
    }
    public void setUpdate(boolean update){
        this.updateResult=update;
    }
}
